package com.eshop.modules.mp.error;

import org.springframework.http.HttpStatus;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.stereotype.Component;
import org.springframework.boot.web.server.ErrorPageRegistrar;

@Component
public class ErrorPageConfiguration implements ErrorPageRegistrar
{
    public void registerErrorPages(final ErrorPageRegistry errorPageRegistry) {
        errorPageRegistry.addErrorPages(new ErrorPage[] { new ErrorPage(HttpStatus.NOT_FOUND, "/error/404"), new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500") });
    }
}
